import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;


public class Separator
{
	
	public static void main(String arg[]) throws ParseException
	{
		
		String parse_time="2012-06-31T01:06:00";//------------- parsed date time
		int i=parse_time.indexOf('T');
		int i1=parse_time.length();
		
		
		
			
		String str1=parse_time.substring((i+1),(i+3));
		int hour1=Integer.parseInt(str1);
		String str2=parse_time.substring((i+4),(i+6));
		int min1=Integer.parseInt(str2);
		String str3=parse_time.substring((i+7),(i1));
		int sec1=Integer.parseInt(str3);
		String s0=parse_time.substring((0),(4));
		int year1=Integer.parseInt(s0);
		String s1=parse_time.substring((5),(7));
		int month1=Integer.parseInt(s1);
		String s2=parse_time.substring((8),(10));
		int date1=Integer.parseInt(s2);
		
		
		Calendar currentDate = Calendar.getInstance();
		
		
		SimpleDateFormat formatte= new SimpleDateFormat(("yyyy"));
		SimpleDateFormat formatt= new SimpleDateFormat(("MM"));
		SimpleDateFormat format= new SimpleDateFormat(("dd"));
		SimpleDateFormat formatterr= new SimpleDateFormat(("HH"));
		SimpleDateFormat formatterrr= new SimpleDateFormat(("mm"));
		SimpleDateFormat formatterrrr= new SimpleDateFormat(("ss"));
		
			
		
		String str4 = formatterr.format(currentDate.getTime());
		int hour=Integer.parseInt(str4);
		String str5 = formatterrr.format(currentDate.getTime());
		int min=Integer.parseInt(str5);
		String str6 = formatterrrr.format(currentDate.getTime());
		int sec=Integer.parseInt(str6);
		String s3 = formatte.format(currentDate.getTime());
		int year=Integer.parseInt(s3);
		String s4 = formatt.format(currentDate.getTime());
		int month=Integer.parseInt(s4);
		String s5 = format.format(currentDate.getTime());
		int date=Integer.parseInt(s5);
			

		Calendar calendar1 = Calendar.getInstance();
	    Calendar calendar2 = Calendar.getInstance();
	    calendar1.set(year1, month1,date1);
	    calendar2.set(year, month, date);
	    long milsecs1= calendar1.getTimeInMillis();
	    long milsecs2 = calendar2.getTimeInMillis();
	    long diff = milsecs2 - milsecs1;
	    
	    int h1=hour-hour1;
	    
		long ddays = diff / (24 * 60 * 60 * 1000);
	    
	    
	    if((ddays>=1)&&(ddays<=30))
	    {
	    	int week=(int) (ddays/7);
	    	if(week==0)
	    	{
	    		System.out.println(ddays + " day(s) ago");
	    	}
	    	else
	    	{
	    		System.out.println(week+" week(s) ago");
	    	}
	    }
	    
	    else if((ddays>30) && (ddays<366))
	    {
	    	int month2=(int) (ddays/30);
	    	System.out.println(month2 +" month(s) ago");
	    }
	    else if(ddays>365)
	    {
	    	int year2=(int) (ddays/365);
	    	System.out.println(year2 + " year(s) ago");
	    }
	    else if((ddays<1)&&(h1<=24))
	    {
	    	if(hour<hour1)
	    	{
	    		int k=hour1-hour;
	    		int difff=24-k;
	    		System.out.println(difff+ " hours ago");
	    	}
	    	if(hour1<=hour)
	    	{
	    		int h=hour-hour1;
	    		
	    		if(h>0)
	    		{
	    			if(min1<min)
	    			{
	    				System.out.println(h+" hour(s) ago");
	    			}
	    			else if (min<min1)
	    			{
	    				System.out.println((h-1)+" hour(s) ago");
					}
	    			else
	    			{
	    				System.out.println((h-1)+" hour(s) ago");
	    			}
	    			
	    		}
	    		if(h==0)
	    		{
	    			if(min1<min)
	    			{
	    				int m=min-min1;
	    				System.out.println(m + " minute(s) earlier");
	    			}
	    			else if(min1==min)
	    			{
	    				if(sec1<sec)
		    			{
		    				System.out.println("few seconds earlier");
		    			}
                   
                   //i am sending you comment check this
	    			}
	    		}
	    	}
	    }
	}
}	



